﻿@{
    ViewBag.Title = "Questions";
}

<script>
    window.questionListType = "@ViewBag.ActiveTab";
</script>
@Scripts.Render("~/bundles/ListQuestionJsBundle")
 
<div ng-controller="ListQuestionController" ng-init="init()" class="qMain row">
    <div class="col-md-9">
        <p ng-show="loadError" class="alert alert-danger">Oops! Something went wrong. Refresh this page to try again.</p>
        <div class="btn-group" role="group" aria-label="...">
            <a href="/?tab=recent" type="button" class="@(ViewBag.ActiveTab == "recent" ? "active btn btn-default" : "btn btn-default")">Recent</a>
            <a href="/?tab=unanswered" type="button" class="@(ViewBag.ActiveTab == "unanswered" ? "active btn btn-default" : "btn btn-default")">Unanswered</a>
        </div>
        <div class="list">
            <p ng-show="noQuestionsFound" class="alert alert-warning">No questions found.</p>
            <div ng-table="tableParams" class="singleq" ng-repeat="q in questions">
                <div class="summary pull-left">
                    <span class="item pull-left votes">
                        <span class="count text-center">0</span>
                        <label class="text-center">votes</label>
                    </span>
                    <span class="item pull-left answers">
                        <span class="count text-center">0</span>
                        <label class="text-center">answers</label>
                    </span>
                    <span class="item pull-left views">
                        <span class="count text-center">0</span>
                        <label class="text-center">views</label>
                    </span>
                </div>
                <div class="detail pull-left">
                    <span class="title"><a href="/questions/details/{{q.Id}}">{{q.Title}}</a></span>
                    <p>
                        <span class="user pull-right other"><a href="/">- Yasser Shaikh</a></span>
                        <span class="date pull-right other">
                            asked <abbr class="timeago" title="{{q.CreationDate | jsonDate | date: 'MMM d, y h:mm a'}}">{{q.CreationDate | jsonDate | date: 'MMM d, y h:mm a'}}</abbr>
                        </span>
                    </p>
                </div>
            </div>
        </div>
    </div>
    
    @Html.Partial("~/Views/Shared/Sidebar.cshtml")
</div>